Learn R Programming

SpatialNP (version 1.1-5)

Spatial sign and rank covariance matrices: Spatial sign and rank covariance matrices

Description

Functions to compute spatial sign, spatial symmetrized sign, spatial rank and spatial signed rank covariance matrices

Usage

SCov(X, location = NULL, na.action = na.fail)
SSCov(X, na.action = na.fail)
RCov(X, na.action = na.fail)
SRCov(X, location = NULL, na.action = na.fail)

Arguments

X

matrix or a data frame

location

numeric vector (may be missing)

na.action

a function which indicates what should happen when the data contain 'NA's. Default is to fail.

Details

These functions compute the matrices of the form $$ ave \{S(x_i) S^T(x_i)\} $$ where \(S(x_i)\) are the appropriate scores of the data: spatial signs, spatial symmetrized signs, spatial ranks or spatial signed ranks. These are the so called outer standardization matrices of location etc. tests based on spatial signs and ranks. They are not affine equivariant.

SCov and SRCov require a location vector with respect to which they are computed. If none is provided, SCov uses spatial median and SRCov uses Hodges-Lehmann estimator.

References

Visuri, S., Koivunen, V. and Oja, H. (2000). Sign and rank covariance matrices. J. Statistical Planning and Inference, 91, 557-575.

See Also

spatial signs and ranks, corresponding shape matrices (inner standardization matrices)

Examples

Run this code
# NOT RUN {
A<-matrix(c(1,2,-3,4,3,-2,-1,0,4),ncol=3)
X<-matrix(rt(150,1),ncol=3)%*%t(A) 
SCov(X) 
SSCov(X) 
RCov(X) 
SRCov(X)
to.shape(A%*%t(A),trace=1) 
# }

Run the code above in your browser using DataLab